package xulychuoi;

public class xulychuoi {
 public static	String getCommand(String x){
		String rs = null;
		int number=0;
		char[] ar = x.toCharArray();
		for(int i=0;i<ar.length;i++){
			if(":".equals(String.valueOf(ar[i]))){
				number=i;
				rs=x.substring(0,number);
			}	
		}
		return rs;	
	}
 
 public static	String getDescription(String x){
		String rs = null;
		int number=x.indexOf(" ");
		rs=x.substring(number+1,x.length());			
		return rs;	
	}

 public static	String getDefault(String x){
		String rs = null;
		int tmp=0;
		int vitri=0;
		char[] ar = x.toCharArray();
		int number=ar.length;
		while(tmp==0){
			if(" ".equals(String.valueOf(ar[number-1])) ){
				tmp=1;
				vitri=number;
			}
			number--;
		}
		
		rs=x.substring(vitri+1,x.length()-2);
		if(rs.equals("NULL"))
			rs="None";
		return rs;	
	}
 public static void main(String[] args) {
	 String test="The factory default “is“ ";
	 test=getDefault(test);
	 System.out.println(test);
 }
 
 
}

